#coding=utf-8
from django.conf.urls import url

from goods import views


urlpatterns =[
    # http://127.0.0.1:8000/index
    url(r'^index', views.IndexView.as_view(), name='index'),

    # 商品详情： http://127.0.0.1:8000/detail/sku_id
    url(r'^detail/(?P<sku_id>\d+)$', views.DetailView.as_view(), name='detail'),

    # 商品列表
    # 默认排序：/list/category_id/page_num/?sort='default'
    # 价格排序：/list/category_id/page_num/?sort='price'
    # 人气排序：/list/category_id/page_num/?sort='hot'
    url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)$', views.ListView.as_view(), name='list'),
]